from django.db import models

# Create your models here.

class UserGroup(models.Model):
    """
    部门
    """
    title = models.CharField(max_length=32)


class UserInfo(models.Model):
    """
    员工
    """

    id = models.AutoField(primary_key=True)  # 如果不写会默认创建一个列名为id 的自增组件
    username = models.CharField(max_length=32)
    password = models.CharField(max_length=64)
    age = models.IntegerField(null=True)
    ug = models.ForeignKey("UserGroup", null=True, on_delete=models.SET_NULL)
